package cn.stylefeng.guns.modular.business.frequency.financecheckdetail.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.business.frequency.financecheckdetail.service.FinanceCheckDetailService;
import cn.stylefeng.guns.modular.business.frequency.financecheckdetail.model.param.FinanceCheckDetailParam;

import javax.annotation.Resource;

/**
 * 对账单结算记录明细表表 控制器
 *
 * @author: yujie
 * @date: 2023/05/09 17:17
 */
@RestController
public class FinanceCheckDetailController {

    @Resource
    private FinanceCheckDetailService financeCheckDetailService;

    /**
     * 分页查询对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeCheckDetail/page")
    @BusinessLog(title = "对账单结算记录明细表表_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(FinanceCheckDetailParam financeCheckDetailParam) {
        return new SuccessResponseData(financeCheckDetailService.page(financeCheckDetailParam));
    }

    /**
     * 获取全部对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeCheckDetail/list")
    @BusinessLog(title = "对账单结算记录明细表表_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(FinanceCheckDetailParam financeCheckDetailParam) {
        return new SuccessResponseData(financeCheckDetailService.list(financeCheckDetailParam));
    }

    /**
     * 查看详情对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeCheckDetail/detail")
    @BusinessLog(title = "对账单结算记录明细表表_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(FinanceCheckDetailParam.detail.class) FinanceCheckDetailParam financeCheckDetailParam) {
        return new SuccessResponseData(financeCheckDetailService.detail(financeCheckDetailParam));
    }

    /**
     * 添加对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeCheckDetail/add")
    @BusinessLog(title = "对账单结算记录明细表表_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(FinanceCheckDetailParam.add.class) FinanceCheckDetailParam financeCheckDetailParam) {
        financeCheckDetailService.add(financeCheckDetailParam);
        return new SuccessResponseData();
    }

    /**
     * 删除对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeCheckDetail/delete")
    @BusinessLog(title = "对账单结算记录明细表表_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(FinanceCheckDetailParam.delete.class) FinanceCheckDetailParam financeCheckDetailParam) {
        financeCheckDetailService.delete(financeCheckDetailParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑对账单结算记录明细表表
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeCheckDetail/edit")
    @BusinessLog(title = "对账单结算记录明细表表_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(FinanceCheckDetailParam.edit.class) FinanceCheckDetailParam financeCheckDetailParam) {
        financeCheckDetailService.edit(financeCheckDetailParam);
        return new SuccessResponseData();
    }


}
